<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html">
  <h:head>
    <title>Bienvenido</title>
    <script type="text/javascript">
      function usuarioInvalido() {
        var variable = '#{tipoUsuario}';
        alert(typeof variable);
        alert(variable);
        if (typeof variable == "undefined") {
          window.location = "faces/login/Login.xhtml";   
        } else {
          if ( variable == '') {
            window.location = "faces/login/Login.xhtml";   
          }
          switch(variable) {
            case "1":
              window.location = "menuadmin.xhtml";
              break;
            case "2":
              window.location = "menuentrenador.xhtml";
              break;
            case "3":
              window.location = "menuusuario.xhtml";
              break;
          }
        }
      }
    </script>
  </h:head>
  <h:body onload="usuarioInvalido()">
  </h:body>
</html>

